package com.travel.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.travel.pojo.entity.User;
import com.travel.pojo.vo.IpDistribution;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("SELECT ip_location as region, COUNT(*) as count FROM users GROUP BY ip_location ORDER BY count DESC LIMIT 5")
    List<IpDistribution> selectIpDistribution();

}
